package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.repository.ITravelTemplateRepository;
import cn.wolfcode.luowowo.search.service.ITravelTemplateSearchService;
import cn.wolfcode.luowowo.search.template.StrategyTemplate;
import cn.wolfcode.luowowo.search.template.TravelTemplate;
import com.alibaba.dubbo.config.annotation.Service;
import org.elasticsearch.client.transport.TransportClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

import java.util.List;

@Service
public class TravelTemplateSearchServiceImpl implements ITravelTemplateSearchService {

    @Autowired
    private ITravelTemplateRepository repository;

    @Autowired
    private ElasticsearchTemplate template;

    @Autowired
    private TransportClient client;

    @Override
    public List<TravelTemplate> findByDestName(String name) {
        return repository.findByDestName(name);
    }

    @Override
    public void saveOrUpdate(TravelTemplate travelTemplate) {
        repository.save(travelTemplate);
    }
}
